﻿function login(){
    let username=$('[name=username]').val()
    let password=$('[name=password]').val()
    // console.log(username);
    let obj = {
        username,password
    }
    console.log(obj);
    $.post('http://localhost:8000/login',obj,(res)=>{
        console.log(res);
        if(res.code==1000){
            window.location.href=`./index.html`
        }else{
            alert('账号或者密码错误，重新输入')
        }
    })
}   